# -*- coding: utf-8 -*-
"""
@author:xuyuntao
@time:2021/1/15:11:20
@email:xuyuntao@189.cn
"""
from AnalogModulation import AnalogModulationDetect as AMD
from AnalogModulation import AnalogModulationGenerator as AMG
from Generator import awgn

"""先通过GAM生成指定调制方式的信号，通过awgn添加噪声，再通过DAM识别该调制信号的调制方式。"""

gam=AMG(3e3, 14e3, 2 * 14e3)  # 模拟调制生成器
dam=AMD(None, 14e3)   # 模拟调制识别器

for _ in ["AM","DSBSC","LSB","USB","FM"]:

    signal=gam.get_signal(_)  # 获取指定调制方式的信号

    noiseSignal=awgn(signal,None) # 添加噪声

    dam.updateSignal(signal)
    dam.getAllOnce()